-- GENERATED SPELL FOR [Wailing Spectre] --


function spell0_12377(pUnit, Event) --@Cry of the Dead,Self--
pUnit:FullCastSpellOnTarget(32938,pUnit)
pUnit:RegisterEvent('Sorts_12377', 7000, 1)
end

function spell1_12377(pUnit, Event) --@Wailing Dead,Self--
pUnit:FullCastSpellOnTarget(7713,pUnit)
pUnit:RegisterEvent('Sorts_12377', 6301, 1)
end

function Sorts_12377(pUnit, Event)
local choix_sorts_12377 = math.random(0, 1)
if choix_sorts_12377 == 0 then
pUnit:RegisterEvent('spell0_12377', 1, 1)
end
if choix_sorts_12377 == 1 then
pUnit:RegisterEvent('spell1_12377', 1, 1)
end
end

function mob12377_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_12377', math.random(1500, 3000), 1)
end

function mob12377_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob12377_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob12377_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(12377, 1, 'mob12377_Action')
RegisterUnitEvent(12377, 2, 'mob12377_Leave')
RegisterUnitEvent(12377, 3, 'mob12377_Kill')
RegisterUnitEvent(12377, 4, 'mob12377_Die')
